package main

import (
	"os"
	"fmt"
	"go-glue.googlecode.com/hg/rlglue"
)

func main() {
	var err os.Error
	defer func() {
		if err != nil {
			panic(err)
		}
	}()
	gt := &GlueTester{"test_sanity", 0, 0}
	ex := new(rlglue.Experiment)
	if err = ex.AutoConnect(); err != nil {
		return
	}
	var taskString string
	if taskString, err = ex.Init(); err != nil {
		return
	}
	gt.check(taskString != "sample task spec")
	if err = ex.Cleanup(); err != nil {
		return
	}
	if err = ex.Close(); err != nil {
		return
	}
	fmt.Printf("%v\n", gt)
	os.Exit(gt.failCount)
}
